<?php
	class chitiet_ctdtdata
	{
		public function Them($ct_ctdt_ma = "", $ct_ctdt_ma_ctdt = "", $ct_ctdt_mamonhoc="",$ct_ctdt_dahoc = "")
		{
			$sql = "INSERT INTO chitiet_ctdt(ct_ctdt_ma, ct_ctdt_ma_ctdt, ct_ctdt_mamonhoc,ct_ctdt_dahoc)
					VALUES('$ct_ctdt_ma', '$ct_ctdt_ma_ctdt', '$ct_ctdt_mamonhoc','$ct_ctdt_dahoc')";
			
			$service = new dataservice();
			return $service->ExecuteNonQuery($sql);
		}
		
		public function CapNhat($ct_ctdt_ma = "", $ct_ctdt_ma_ctdt = "", $ct_ctdt_mamonhoc="",$ct_ctdt_dahoc = "")
		{
			$sql = "UPDATE chitiet_ctdt SET ct_ctdt_ma_ctdt = '$ct_ctdt_ma_ctdt', ct_ctdt_mamonhoc= '$ct_ctdt_mamonhoc', ct_ctdt_dahoc= '$ct_ctdt_dahoc' WHERE ct_ctdt_ma = '$ct_ctdt_ma'";
			
			$service = new dataservice();
			return $service->ExecuteNonQuery($sql);
		}
		
		public function Xoa($cbdt_ma = "")
		{
			$sql = "DELETE FROM chitiet_ctdt WHERE ct_ctdt_ma = '$ct_ctdt_ma'";
			
			$service = new dataservice();
			return $service->ExecuteNonQuery($sql);
		}
		
		public function LayDanhSach($cbdt_ma = "")
		{
			$sql = "SELECT * FROM chitiet_ctdt WHERE 1";
			
			if($ct_ctdt_ma != "")
				$sql .= " AND ct_ctdt_ma = '$ct_ctdt_ma'";
			
			$service = new dataservice();
			return $service->ExecuteQuery($sql);
		}
	}
?>